package com.xlh.dokka.api;

import com.xlh.dokka.api.bo.DokkaClusterInfoBO;
import com.xlh.dokka.api.bo.DokkaContainerBO;
import com.xlh.dokka.api.dto.DokkaContainerCreateDTO;
import com.xlh.dokka.api.exception.DokkaException;

/**
 * @author cheer
 */
public interface DokkaContainerService {

    DokkaClusterInfoBO getClusterInfo();

    DokkaContainerBO createContainer(DokkaContainerCreateDTO dokkaContainerCreateDTO) throws DokkaException;

    void deleteContainer(Long dokkaId);

    // 更新容器配置后，容器处于停止状态
    Boolean updateContainer(Long dokkaId, Integer cpu, Integer memory);

    DokkaContainerBO getContainer(Long dokkaId);

    DokkaContainerBO startContainer(Long dokkaId) throws DokkaException;

    Boolean stopContainer(Long dokkaId);

    Boolean execContainer(Long dokkaId, String command);

    Integer getRunningCount();

    Boolean isSameHost(Long preDokkaId, Long afterDokkaId);
}
